<?php
//inculde即可以使用data数据。本页所有的data数据，倾在controller都处理好
include_once("../../../common/module/checkA.php");
include_once("../../../../config.php");
include_once("../controller/detail-list.php");
/* 权限判断 */
//authorization('product');


$category_list=select_lines_all_items($table_prefix."term","listorder desc , nid desc","interm = 'root' and belong = 'product' ","")

?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

    <? include_once(ROOT_PATH_ . "/controller/common/module/head.php"); ?>

</head>

<body>

<div id="topbar">
    <?php include ROOT_PATH_ . '/controller/common/module/topbar.php'; ?>
</div>


<div id="container" class="member">

    <div id="maincontent">

        <div id="sidebar">
            <?php include ROOT_PATH_ . '/controller/common/module/sidebar.php'; ?>
        </div>

        <div id="content">
            <?php $page_title = '增加产品'; ?>
            <?php include ROOT_PATH_ . '/controller/common/module/mod-page-title.php'; ?>

            <div class="detail-box layui-form">

        <form
                enctype="multipart/form-data"
                action="detail-add-function.php?nav-itemed=menu" method="post"  >
        	<div class=" layui-form">
                <br />

                <div class="layui-form-item">
                    <label class="layui-form-label">商品名字</label>
                    <div class="layui-input-block">
                        <input type="text" name="ai_name" required  lay-verify="required"
                               placeholder="请输入商品名字" autocomplete="off" class="layui-input" value="<? echo $detail['name']?>">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">产品型号</label>
                    <div class="layui-input-block">
                        <input type="text" name="ai_model"
                               placeholder="请输入产品型号" autocomplete="off" class="layui-input" value="<? echo $detail['model']?>">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">商品分类</label>
                    <div class="layui-input-block">
                        <select name="ai_cat_id"  >
                            <option value="" >请选择</option>
                            <?php

                            foreach($category_list as $val){

                                if($val['nid'] == $detail['cat_id']){

                                    $select = 'selected="selected"';
                                }
                                echo '<option value="'.$val['nid'].'"  '.$select.' >'.$val['name'].'</option>';
                            }
                            ?>

                        </select>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">商品价格</label>
                    <div class="layui-input-block">
                        <input type="text" name="ai_price" class="layui-input" required  lay-verify="required"
                               placeholder="请输入价格" autocomplete="off" value="<? echo $detail['price']?>"/>
                    </div>
                </div>




                <div class="layui-form-item">
                    <label class="layui-form-label">排序</label>
                    <div class="layui-input-block">
                        <input type="text" name="ai_listorder"
                               placeholder="" autocomplete="off" class="layui-input" value="<? echo $detail['listorder']?>">
                    </div>
                </div>

                <? include("mod-images-upload.php");?>




                <div class="layui-form-item">
                    <label class="layui-form-label">是否显示</label>
                    <div class="layui-input-block">
                        <input type="radio" name="ai_publish" value="0" title="下架"
                            <? if($detail['publish']=="0"){echo "checked";} ?>
                            >
                        <input type="radio" name="ai_publish" value="1" title="上架"
                            <? if($detail['publish']=="1"){echo "checked";} ?>
                            >

                    </div>
                </div>


                <input name="now_extender" type="hidden" value="<? echo $_REQUEST['now_extender'] ?>"/>


                <div class="function">
                       <button class="layui-btn" >立即提交</button>
                </div>


            </div>
        </form>
    </div>
</div>



<!--content端點01-->
</div>
<!--maincontent端點01-->
<br class="clearfloat"/>
</div>
<!--container端點01-->
</div>








<?php include ROOT_PATH_ . "/controller/common/module/footer.php"; ?> </body>
</html>

